#include <iostream>
using namespace std;

// 已知
int t, n;
string s;
// 未知
int p;


int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n >> s;
        p = 0;
        while (p < n - 1 and s[p] <= s[p + 1])
        {
            cout << s[p++];
        }
        char c = s[p++];
        while (p < n and c >= s[p])
        {
            cout << s[p++];
        }
        cout << c << s.substr(p) << endl;
    }
    return 0;
}